package com.example.aopdemo.demos.aspect;

import lombok.extern.slf4j.Slf4j;
import org.aspectj.lang.annotation.After;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;

@Slf4j
@Component
@Aspect
public class MyAspectDemo {
    @Before("@annotation(com.example.aopdemo.demos.aspect.MyAspect)")
    public void doBefore(){
        log.info("执行MyAspectDemo before...");
    }

    @After("@annotation(com.example.aopdemo.demos.aspect.MyAspect)")
    public void doAfter(){
        log.info("执行MyAspectDemo After...");
    }
}
